import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase="DBshop007_销售管理发货单"
# 1.点击销售管理发货单。
firefox=openBrowser("http://localhost/dbshop/admin")
DBshopLoginAdmin(firefox)
DBshopEnterMenu2(firefox,"销售管理","发货单")
# 2.点击“查看”按钮，可以查看发货单已发货和未发货信息。
rootpath=get_pro_rootpath()
filepath=rootpath+r'\public\order2.txt'
oderNumber=readFile(filepath)
# 轴定位：定位订单号-->定位“查看”(following-sibling::)
firefox.find_element_by_xpath("//td[text()=%s]/following-sibling::td[5]/a"%oderNumber).click()
# 断言
try:
    if firefox.find_element_by_xpath("//span[@class='text-success']").text=="已收货":
        writeLog("%s 测试通过" % testCase)
except:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
firefox.quit()
